package com.service.auth;

import java.util.List;

import com.model.auth.User;

public interface IUserService {
	
	/**
	 * 根据用户名查询用户
	 * @param userName
	 * @return
	 * @throws Exception
	 */
	public User getUserByName(String userName) throws Exception;
	
	
	/**
	 * 根据用户ID 查询出所有的用户资源
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<String> getUserRolesResId(Integer userId) throws Exception;
	
	
	/**
	 * 分页查询所有用户
	 * @param offset 偏移量
	 * @param max 条数
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<User> getUserPageList(int pageNo,int max) throws Exception;
	
	
	/**
	 * 查询用户总数
	 * @return
	 * @throws Exception
	 */
	public int getUserCount() throws Exception;
	
	
	/**
	 * 插入用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Integer insertUser(User user) throws Exception;
	
	/**
	 * 更新用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public boolean updateUser(User user) throws Exception;
	
	
	/**
	 * 根据ID 查询user对象
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public User getUserById(Integer id) throws Exception;
	
	
	/**
	 * 根据ID 删除用户
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean delUserById(Integer id) throws Exception;
	
	/**
	 * 修改用户密码
	 * @param userId
	 * @param pwd
	 * @return
	 * @throws Exception
	 */
	public boolean updateUserPwd(Integer userId,String pwd) throws Exception;
	
	/**
	 * 登录次数
	 * @param userId
	 * @param pwd
	 * @return
	 * @throws Exception
	 */
	public boolean updateUserCount(User user) throws Exception;
	
}
